<?php
class Phim extends Database
{
    public function __construct()
    {
        $this->connect();
    }
    public function quocgia()
    {
        $sql="select * from quocgia";
        $this->query($sql);
		if($this->num_rows() !=false)
		{
			while($row=$this->fetch())
			{
				$data[]=$row;
			}
			return $data;
		}
    }
    public function chuyenngu()
    {
        $sql="select * from chuyenngu";
        $this->query($sql);
		if($this->num_rows() !=false)
		{
			while($row=$this->fetch())
			{
				$data[]=$row;
			}
			return $data;
		}
    }
    public function chatluong()
    {
        $sql="select * from chatluong";
        $this->query($sql);
		if($this->num_rows() !=false)
		{
			while($row=$this->fetch())
			{
				$data[]=$row;
			}
			return $data;
		}
    }
    public function loaiphim()
    {
        $sql="select * from loai";
        $this->query($sql);
		if($this->num_rows() !=false)
		{
			while($row=$this->fetch())
			{
				$data[]=$row;
			}
			return $data;
		}
    }
    public function nhasx()
    {
        $sql="select * from nhasx";
        $this->query($sql);
		if($this->num_rows() !=false)
		{
			while($row=$this->fetch())
			{
				$data[]=$row;
			}
			return $data;
		}
    }
    public function daodien()
    {
        $sql="select * from daodien";
        $this->query($sql);
		if($this->num_rows() !=false)
		{
			while($row=$this->fetch())
			{
				$data[]=$row;
			}
			return $data;
		}
    }
	public function theloai()
	{
		$sql="select * from theloai;";
		$this->query($sql);
		if($this->num_rows() !=false)
		{
			while($row=$this->fetch())
			{
				$data[]=$row;
			}
			return $data;
		}
	}
	public function dienvien()
	{
		$sql="select * from dienvien;";
		$this->query($sql);
		if($this->num_rows() !=false)
		{
			while($row=$this->fetch())
			{
				$data[]=$row;
			}
			return $data;
		}
	}
	public function show_phim()
	{
		$sql="select * from phim";
		$this->query($sql);
		while($row=$this->fetch())
		{
			$data[]=$row;
		}
		return $data;
	}
	public function xoa_phim($id)
	{
		$sql="delete from phim where maphim='".$id."'";
		$this->query($sql);
	}
	public function danhsach_phim_pt($sql)
	{
		$this->query($sql);
		if($this->num_rows() !=false)
		{
			while($row=$this->fetch2())
			{
				$data[]=$row;
			}
			return $data;
		}
	}
    
}